﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (HttpContext.Current.User.Identity.IsAuthenticated == false)
        {
            lnkCreaza.Visible = false;
            lnkAdauga.Visible = false;
            lnkDesc.Visible = false;
        }
        else
        {
            lnkDesc.Visible = true;
            if ( HttpContext.Current.User.Identity.Name=="bogdan")
            {
                lnkCreaza.Visible = true;
                lnkAdauga.Visible = true;
                
            }
            else
            {
                lnkCreaza.Visible = false;
                lnkAdauga.Visible = false;
            }
        }
    }

    protected void Login1_LoggedIn(object sender, EventArgs e)
    {
        if (HttpContext.Current.User != null && HttpContext.Current.User.Identity.Name != "bogdan")
        {
            Response.Redirect("~/DownloadFile.aspx");
        }
    }
}
